<form action="index.php/area/insert/" method="post" name="myform"  onSubmit="return check()">
<div id="inline2">
<h2><span>区域信息</span></h2>
<table>
        <tr><th colspan="5">&nbsp;</th></tr>
        <tr>
        	<td align="right" bgcolor="#E5E5E5" class="name"><span>*</span>区域名称：</td>
          <td><input style="" type="text" name="district" ></input></td>
        </tr>
        <tr><td colspan="2">&nbsp;</td></tr>
        <tr class="sub">
            <td colspan="2"><input type="submit" value="提交" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" /></td>
        </tr>
    </table>
</div>
</form>
<script type="text/javascript">
	function check(){
		var error="";
		var district=document.getElementsByName("district")[0].value;
		if(district == ""){
			 error="错误：\x0d";
             error+="区域名称不允许为空,请填写\x0d";
	    }
        if(error != ""){
        	document.myform.district.focus();
        	alert(error);
    		return false;
        }else{
            return true;
        }
	}
</script>